<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05-改变事件</title>
    <script>
        window.onload=function (){
            let inputEle = document.getElementById("uName");
            inputEle.onchange=function () {
                console.log(inputEle.value+"改变");
            }
            let cityEle = document.getElementById("city");
            cityEle.onchange=function () {
                console.log(cityEle.value+"改变");
            }
        }
    </script>
</head>
<body>
<input type="text" name="username" id="uName" placeholder="请输入用户名：">

<select name="city" id="city">
    <option value="1">北京</option>
    <option value="2">上海</option>
    <option value="3">广东</option>
    <option value="4">深圳</option>
</select>
</body>
</html>